package com.zzti.controller;

import com.alibaba.fastjson.JSONArray;
import com.zzti.serviceImpl.OrderEquServerImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping()
public class OrderEquController {

    @Autowired
    private OrderEquServerImpl orderEquServer;


    @GetMapping("/selectByTime")
    @ResponseBody
    public String selectByTime() {
        int[] arr1 = new int[12];
        for (int i = 0; i < arr1.length; i++) {
            arr1[i] = i * 2;
        }
        int[] arr2 = orderEquServer.selectByTime();
        JSONArray jsonArray = new JSONArray();
        jsonArray.add(arr1);
        jsonArray.add(arr2);
        System.out.println(jsonArray);
        String result2 = jsonArray.toJSONString();
        return result2;
    }
}
